﻿<%@ Page Title="" Language="C#" MasterPageFile="~/webmx/layout/Default.master" AutoEventWireup="true" CodeFile="List.aspx.cs" Inherits="webmx_program_gongde_List" %>

<asp:Content ID="Content1" ContentPlaceHolderID="mp_head" runat="Server">
    <link rel="stylesheet" href="/webmx/css/uniform.css" />
    <link rel="stylesheet" href="/webmx/css/select2.css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mp_body" runat="Server">
    <div class="container-fluid">
        <div class="row-fluid">
            <div class="span12">
                <div class="widget-box">
                    <div class="widget-title">
                        <span class="icon"><i class="icon-th"></i></span>
                        <h5>同善基金管理</h5>
                        <div style="float: left; padding: 0 20px; height: 36px; line-height: 33px;"><a href="add.aspx" class="btn btn-success btn-mini">添加基金</a></div>
                    </div>
                    <div class="widget-content nopadding">
                        <table class="table table-bordered data-table">
                            <thead>
                                <tr>
                                    <th style="width: 60px;">图标</th>
                                    <th>名称</th>
                                    <th>金额</th>
                                    <th>排列顺序</th>
                                    <th style="width: 60px;">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <%
                                    if (data != null && data.Count > 0)
                                    {
                                        foreach (var item in data)
                                        {
                                %>
                                        <tr class="gradeX">
                                            <td style="text-align:center;"><img src="/upload/gd/<%=item.Photo %>" style="width: 50px;" /></td>
                                            <td><%=item.Title %></td>
                                            <td><%=item.Attachment %></td>
                                            <td class="center"><%=item.SortID %></td>
                                            <td class="center">
                                                <a href="set.aspx?id=<%=item.ID %>">编辑</a>
                                                <a class="btn_del" href="javascript:void(0);" data-id="<%=item.ID %>">删除</a>
                                            </td>
                                        </tr>
                                <% 
                                        }
                                    }
                                %>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="mp_foot" runat="Server">
    <script type="text/javascript" src="/webmx/js/jquery.uniform.js"></script>
    <script type="text/javascript" src="/webmx/js/select2.min.js"></script>
    <script type="text/javascript" src="/webmx/js/jquery.dataTables.min.js" charset="gb2312"></script>
    <script type="text/javascript" src="/webmx/js/matrix.tables.js"></script>
    <script>
        $("#sidebar ul li").removeClass("active").eq(2).addClass("active");

        $(".btn_del").click(function () {
            var row = $(this).parent().parent();
            $.get("del.ashx", "id=" + $(this).attr("data-id") + "&temp=" + new Date().getTime(), function (data) {
                if (data) {
                    var table = $("#odata").dataTable();
                    row.remove();
                    alert("操作成功");
                }
                else alert("操作失败");
            });
        });
    </script>
</asp:Content>

